<?php

class Action_UserLogin extends Action
{
	public function _doAction()
	{
		if($user=UserAuth::login(Request::getParameter("username"), Request::getParameter("password")))
		{
			User::setData("isLoggedIn", true);
			User::setData("userId", $user["id"]);
			Controller::redirect("news", "index");
		}
		User::setData("loginError", "Rossz felhasználónév vagy jelszó!");
		Controller::redirect("news", "index");
	}
}